const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
module.exports = smp.wrap({
  mode: 'development',
  devtool: 'cheap-module-source-map',
  // 监控代码变化，重新打包，并刷新浏览器
  devServer: {
    // contentBase: './dist' // 读取静态资源
    // publicPath: '/assets/',
    port: 8000
  },
  module: {
    rules: [
      {
        test: /\.less$/,
        use: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader'],
      },
      {
        test: /\.(sass|scss)$/,
        use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
      }
    ]
  }
})

